package basic;
//TODO: 需要再看
public class basic812 {

    public double largestTriangleArea(int[][] points) {
        double area = 0;
        for (int i = 0; i < points.length - 2; i ++) {
            for (int j = i + 1; j < points.length - 1; j ++) {
                for (int k = j + 1; k < points.length; k ++) {
                    double tmp = getArea(points[i], points[j], points[k]);
                    if (tmp > area) area = tmp;
                }
            }
        }
        return area;
    }

    public double getArea(int[] P, int[] Q, int[] R){
        return 0.5 * Math.abs(P[0]*Q[1] + Q[0]*R[1] + R[0]*P[1]
                -P[1]*Q[0] - Q[1]*R[0] - R[1]*P[0]);
    }



    public static void main(String[] args) {
        int[][] temp;
        temp=new int[][]{{1,1},{3,2},{2,3},{7,8},{9,10}};
        basic812 basic812 = new basic812();
        double v = basic812.largestTriangleArea(temp);
        System.out.println(v);
    }

}
